<div id="page">
    <?php print render($page['help']); ?>
    <header class="header" id="header" role="banner">
        <div class="wrapper">

            <?php if ($logo): ?>
            <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" class="header__logo" id="logo">
                <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" class="header__logo-image" />
            </a>
            <?php endif; ?>

            <?php print render($page['header']); ?>
            <?php print render($page['navigation']); ?>

        </div>
    </header>
    <?php print $messages; ?>

    <?php if ($title): ?>
    <h1 class="page__title title element-invisible" id="page-title"><?php print $title; ?></h1>
    <?php endif; ?>

    <?php print render($page['highlighted']); ?>

    <div id="main">
        <div id="content" class="column region-content" role="main">
            <article class="app" data-nid="<?php echo $node->nid; ?>">
                <div class="section-left">
                    <div class="wrapper">
                        <?php print $breadcrumb; ?>
                        <?php print render($title_prefix); ?>
                        <?php print render($title_suffix); ?>
                        <?php print render($tabs); ?>
                        <?php if ($action_links): ?>
                        <ul class="action-links"><?php print render($action_links); ?></ul>
                        <?php endif; ?>
                        <h2 class="node-title"><?php print $title?></h2>
                        <div class="article-top">

                            <?php echo jessica_thm_author_author_section($node); ?>
                            <div class="article-share">
                                <div class="article-share-amount">
                                    <?php if (!empty($node->field_social_count)): ?>
                                        <strong><?php print $node->field_social_count['und'][0]['value']; ?></strong>
                                    <?php else: ?>
                                        <strong>0</strong>
                                    <?php endif; ?>SHARES</div>
                                <div class="article-share-action">
                                    <a href="#" class="article-share-open icon icon-share"></a>
                                    <a href="#" class="article-share-close icon icon-cross"></a>
                                    <a href="#" class="article-share-icon icon icon-facebook" target="_blank"></a>
                                    <a href="#" class="article-share-icon icon icon-sina" target="_blank"></a>
                                    <a href="#" class="article-share-icon icon icon-pinterest" target="_blank"></a>
                                    <a href="#" class="article-share-icon icon icon-email"></a>
                                    <button class="article-share-toggle">SHARE</button>
                                </div>
                            </div>
                        </div>
                        <div class="field-image">
                            <div class="field-image-inner">
                                <div class="img-wrapper">
                                    <img src="<?php print image_style_url('styling_article_image', $node->field_image['und'][0]['uri']); ?>" alt="<?php print $node->field_image['und'][0]['alt']; ?>" title="<?php print $node->field_image['und'][0]['title']; ?>" />
                                    <div class="pin-toggle"></div>
                                </div>
                                <!--<div class="field-image-palette">
                                    <?php /*$view = _get_styling_item_styling_article_colours_view(); */?>
                                    <?php /*foreach ($view->result as $result): */?>
                                        <?php /*if (!empty($result->field_field_item_colour)): */?>
                                            <?php /*if ($result->field_field_item_colour[0]['rendered']['#markup'] != 'OTHER'): */?>
                                                <div style="background-color: <?php /*print $result->field_field_item_colour[0]['rendered']['#markup']; */?>"></div>
                                            <?php /*else: */?>
                                                <div class="other-color"></div>
                                            <?php /*endif; */?>
                                        <?php /*endif; */?>
                                    <?php /*endforeach; */?>
                                </div>-->
                            </div>
                        </div>

                        <div class="field-body">
                            <?php print $node->body['und'][0]['safe_value'] ?>
                        </div>

                        <!--<div class="field-tags">
                            <h3>Search related looks</h3>
                            <?php /*print views_embed_view('styling_article', 'related_looks'); */?>
                        </div>-->

                        <div class="field-tags">
                            <h3>Search brands from this look</h3>
                            <?php print views_embed_view('styling_article', 'styling_article_brands'); ?>
                        </div>

                        <div class="field-tags">
                            <h3>Search items for this look</h3>
                            <?php print views_embed_view('styling_article', 'items_by_look'); ?>
                        </div>

                        <?php
                            print _get_block('scmedia_fb_comment','facebook_comment');
                        ?>

                        <div class="sa-morelook">
                            <a href="/stylebook">More look</a>
                        </div>

                        <?php $view = _get_related_style_articles_block();?>
                        <?php if (count($view->result) > 0): ?>
                            <div class="sa-suggestion">
                                <h3>Style you may like</h3>

                                <?php foreach ($view->result as $result): ?>
                                    <?php $entity = $result->_field_data['nid']['entity']; ?>
                                    <?php $items = $result->field_field_styling_item; ?>
                                    <a href="<?php print base_path() . drupal_get_path_alias('node/' . $result->nid); ?>">
                                        <?php if (! empty($entity->field_image)): ?>
                                            <img src="<?php print image_style_url('related_styling_article_thumbnail', $entity->field_image['und'][0]['uri']); ?>" alt="<?php print $entity->field_image['und'][0]['alt']; ?>" title="<?php print $entity->field_image['und'][0]['title']; ?>" />
                                        <?php endif; ?>
                                    </a>
                                <?php endforeach; ?>
                            </div>
                        <?php endif; ?>

                        <?php //print render($page['content']); ?>
                    </div>
                </div>

                <div class="section-right">
                    <div class="wrapper">

                        <div class="sa-team">
                            <div>
                                <?php if (! empty($node->field_stylist_image)): ?>
                                    <img src="<?php print image_style_url('author_thumbnail', $node->field_stylist_image['und'][0]['uri']); ?>" alt="<?php print $node->field_stylist_image['und'][0]['alt']; ?>" title="<?php print $node->field_stylist_image['und'][0]['title']; ?>" />
                                <?php endif; ?>
                                <div class="sa-team-text">
                                    <h3>Styling : <?php print $node->field_stylist['und'][0]['safe_value']; ?></h3>
                                </div>
                            </div>
                            <div>
                                <?php if (! empty($node->field_model_image)): ?>
                                    <img src="<?php print image_style_url('author_thumbnail', $node->field_model_image['und'][0]['uri']); ?>" alt="<?php print $node->field_model_image['und'][0]['alt']; ?>" title="<?php print $node->field_model_image['und'][0]['title']; ?>" />
                                <?php endif; ?>
                                <div class="sa-team-text">
                                    <?php if(isset($node->field_model) && !empty($node->field_model['und'])): ?>
                                        <h3>Model : <?php print $node->field_model['und'][0]['safe_value']; ?></h3>
                                    <?php endif; ?>
                                    <?php if(isset($node->field_model_description) && !empty($node->field_model_description['und'])): ?>
                                        <p><?php print $node->field_model_description['und'][0]['safe_value']; ?></p>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>

                        <?php
                            $sidebar_first  = render($page['sidebar_first']);
                            if ($sidebar_first) {
                                print $sidebar_first;
                            }
                        ?>

                        <div class="sa-right-banner">
                            <?php print bck_render_('ads-article-300x250'); ?>
                        </div>

                        <div class="sa-items">
                            <?php print views_embed_view('styling_article', 'styling_article_sidebar'); ?>
                        </div>
                    </div>
                </div>
            </article>

        </div>
    </div>
    <?php //print render($page['below_content']); ?>
    <?php print render($page['bottom']); ?>
    <?php print render($page['footer']); ?>

</div>

<?php print render($page['popup']); ?>
<?php print render($page['overlay']); ?>
<?php print render($page['hidden']); ?>
